using System.Data;
using ET;
namespace DAL
{
    public class Destination_DAL
    {
        private readonly clsConnect cls = new clsConnect();

        #region Getdata
        public DataTable BindGirdtb_Destination(string keywords)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@KeyWords", keywords);
            return cls.GetData("sp_tb_Destination_Search");
        }
        public DataTable BindGirdtb_DestinationDetail(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Destination_ID", id);
            return cls.GetData("sp_tb_Destination_Detail");
        }
        #endregion

        #region Insert
        public bool Inserttb_Destination(Destination_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Destination_Alias", data.Destination_Alias);
            cls.AddParameter("@Destination_Name", data.Destination_Name);
            cls.AddParameter("@Destination_Note", data.Destination_Note);
            cls.AddParameter("@Destination_User_Add", data.Destination_User_Add);
            cls.AddParameter("@Destination_Date_Add", data.Destination_Date_Add);
            cls.AddParameter("@Destination_Computer_Add", data.Destination_Computer_Add);
            return cls.ExecuteNonQuery("sp_tb_Destination_Insert");
        }
        #endregion

        #region Update
        public bool Updatetb_Destination(Destination_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Destination_ID", data.Destination_ID);
            cls.AddParameter("@Destination_Alias", data.Destination_Alias);
            cls.AddParameter("@Destination_Name", data.Destination_Name);
            cls.AddParameter("@Destination_Note", data.Destination_Note);
            cls.AddParameter("@Destination_User_Modify", data.Destination_User_Modify);
            cls.AddParameter("@Destination_Date_Modify", data.Destination_Date_Modify);
            cls.AddParameter("@Destination_Computer_Modify", data.Destination_Computer_Modify);
            return cls.ExecuteNonQuery("sp_tb_Destination_Update");
        }
        #endregion

        #region Delete
        public bool Deletetb_Destination(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Destination_ID", id);
            return cls.ExecuteNonQuery("sp_tb_Destination_Delete");
        }
        #endregion
    }
}